import { createApp } from 'vue'
import { createPinia } from 'pinia'
import piniaPersist from 'pinia-plugin-persist'
import * as ElementPlusIconsVue from '@element-plus/icons-vue'
import './style.css'
import App from './App.vue'
import directive from './directive'
// import { Loading } from 'element-ui';

// 路由
import router from '@/router/index'
// pinia
const pinia = createPinia()
pinia.use(piniaPersist)

const app = createApp(App)
for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
  app.component(key, component)
}
// 注册全局指令
app.use(directive)

app.use(router).use(pinia).mount('#app')

export default app